function getFormGird(okfun,fieldnameList,tablename){
	var sm = new Ext.grid.CheckboxSelectionModel({
				singleSelect : false,
				//checkOnly:true,
				handleMouseDown:function(g, rowIndex, e){
					if(e.getTarget().className !== 'x-grid3-row-checker')
						Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.call(this,g, rowIndex, e);
				}
				
			});
	var cm = new Ext.grid.ColumnModel([ sm, {
			id : 'name',
			header : '字段名称',
			dataIndex : 'name',
			width : 100,
			sortable : true,
			forceValidation : true
		} , {
			id : 'cnname',
			header : '中文名',
			dataIndex : 'cnname',
			width : 150,
			sortable : true
		}, {
			id : 'datatype',
			header : '数据类型',
			dataIndex : 'datatype',
			width : 80,
			sortable : true,
			renderer:formatArrayStr( {'s':'字符型' , 'n': '数字型' ,  'd': '日期型' })
		} ]);
	var dataRecord = Ext.data.Record.create([
			{name : 'columnid',	type : 'string'},
			{name : 'tablecode',	type : 'string'},
			{name : 'name',	type : 'string'},
			{name : 'datatype',	type : 'string'},
			{name : 'datalength',	type : 'string'},
			{name : 'scale',	type : 'string'},
			{name : 'codetype',	type : 'string'},
			{name : 'codeformat',	type : 'string'},
			{name : 'sourcetable',	type : 'string'},
			{name : 'sourcecolumn',	type : 'string'},
			{name : 'nullable',	type : 'string'},
			{name : 'dboprflag',	type : 'string'},
			{name : 'defaultvalue',	type : 'string'},
			{name : 'used',	type : 'string'},
			{name : 'systempretag',	type : 'string'},
			{name : 'filter',	type : 'string'},
			{name : 'cnname',	type : 'string'},
			
			{name : 'coltype',	type : 'string'}
			]);

    var frm1 =null; 
    var vwindow =null;
    
   
	var store = new Ext.data.Store({
			listeners:{
				load:function(){
					if(fieldnameList!=null){
							var records=[]
							
							for(var j=fieldnameList.length-1;j>=0;j--){
								var record=this.getById(fieldnameList[j]);
								if(record!=null){
									records.push(record);
									this.remove(record);
								}
							}
							if(records.length>0){
								this.insert(0,records);
								sm.selectRange(0,records.length-1);
								okfun();
							}
						}
				
					
					
				}
			
			},
			baseParams:{tablename:tablename}, 
			autoLoad : {tablename:tablename},
				proxy : new Ext.data.HttpProxy({
						url :basepath+'../sysControl/system/SysDicColumnController/query.do'

						}),

				reader : new Ext.data.JsonReader({
							totalProperty : 'results',
							id:'name'
							}, dataRecord)
			});

	var grid= new Ext.grid.GridPanel({
		cm : cm,
		ddGroup   : 'gridDDGroup',
		enableDragDrop   : true,
		listeners :{
			render:function(){
					loadSelect=function(){
						
					}
				
				
			}
			
			
		},
		moveRow:function(moveZ){
					var record = this.getSelectionModel().getSelected();
					if(record){
	                    var store= this.getStore();
	                    var index=store.indexOf(record);
						var indexZ=index+moveZ;
						if(indexZ>=0&&indexZ<store.getCount()){
							store.remove(record);
							store.insert(indexZ,record);
							 this.getSelectionModel().selectRow(indexZ);
							
						}
                }
		},
		sm : sm,
		width:242,
		height:frame_center.getInnerHeight()-248,
		store : store,
		region : 'north',
		tbar : [{
			text : '下移',
			iconCls : 'table_add',
			handler : function() {
			grid.moveRow(1);
			}
		},{
			text : '上移',
			iconCls : 'table_delete',
			handler : function() {
				grid.moveRow(-1);
			}
		},{
			text : '确定',
			iconCls : 'table_delete',
			handler : okfun
		}
		]
	});
	
	grid.on("render",function(){
		//var gridDropTargetEl =  grid.getView().el.dom.childNodes[0].childNodes[1];
		var gridDropTarget = new Ext.dd.DropTarget(grid.container, {
			ddGroup    : 'gridDDGroup',
			copy       : false,
			notifyDrop : function(ddSource, e, data){
				 var rows=grid.getSelectionModel().getSelections();
				var count = rows.length;
				 var cindex=ddSource.getDragData(e).rowIndex;
				store.insert(cindex,rows);
				grid.getView().refresh();
		     	 sm.selectRecords(rows)
			}
		});
	});
	return grid;
}